package com.newlink.building.common_base.activities

import android.os.Bundle
import android.view.View
import android.view.Window
import com.bumptech.glide.Glide
import com.newlink.building.common_base.R
import com.newlink.building.common_base.base.NL_BaseActivity
import com.newlink.building.common_base.databinding.ActivityImageZoomBinding

/**
 * Created by xiaodong on 2025/3/13.
 */
class Base_ImageZoomActivityNL : NL_BaseActivity() {
    private lateinit var mBinding: ActivityImageZoomBinding
    override fun attachLayoutRes(): View? {
        mBinding = ActivityImageZoomBinding.inflate(layoutInflater)
        return mBinding.root
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        requestWindowFeature(Window.FEATURE_NO_TITLE)
        super.onCreate(savedInstanceState)
    }

    override fun initData() {
    }

    override fun initView() {
        initColor(R.color.black75)
        intent.getStringExtra("image_url")?.let {
            Glide.with(this).load(it).into(mBinding.ivPhoto)
        }
        mBinding.ivCancel.setOnClickListener {
            finish()
        }
        mBinding.ivPhoto.setOnOutsidePhotoTapListener {
            finish()
        }
    }
}